refactor: unify date filtering with column filter system#23773
Closed
eunjae-lee wants to merge 1 commit intofeat/date-target-insightsfrom
Closed
refactor: unify date filtering with column filter system#23773eunjae-lee wants to merge 1 commit intofeat/date-target-insightsfrom
eunjae-lee wants to merge 1 commit intofeat/date-target-insightsfrom
Conversation
- Replace hardcoded timestampColumn with dynamic getDateColumn(dateTarget) - Update useInsightsBookingParameters to use dateTarget for date range filtering - Remove dateRange from backend service schema and add date handling to buildColumnFilterCondition - Update ClearFiltersButton to exclude dynamic dateTarget instead of hardcoded 'timestamp' - Extract date range from columnFilters in tRPC router instead of separate dateRange parameter - Remove startDate, endDate, and dateTarget from base input schemas - Add support for startTime and createdAt date column filtering in InsightsBookingBaseService - Fix unused variable lint warning in trpc-router.ts Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR refactors the insights date filtering system to unify date filtering with the existing column filter system, replacing the previous separate
dateRangehandling with dynamic column filters based ondateTarget("startTime" or "createdAt").Key Changes:
getDateColumn(dateTarget)functiondateRange,startDate,endDate, anddateTargetfrom schemas and tRPC procedurescolumnFiltersinstead of separate parametersLink to Devin run: https://app.devin.ai/sessions/6095c8602d414a0aabafe2eeaf5af329
Requested by: @eunjae-lee
This PR is stacked on top of #23752.
How should this be tested?
Date Filter Testing:
Previous Period Comparisons:
URL State Persistence:
CSV Export:
Charts and Tables:
Mandatory Tasks (DO NOT REMOVE)
Human Review Checklist
calculatePreviousPeriodDatesas ColumnFilter) for potential runtime issuesMedium Priority:
Checklist